package de.cachaca.lildancefreak;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

import de.cachaca.lildancefreak.valerie.MathsImpl;

public class MathsTest {

	

	
	@Before
	public void hansbambel() throws Exception {
	}

	@Test
	public void testFakultaet() {
		Assert.assertEquals(1, MathsImpl.fakultaet(0));
		Assert.assertEquals(1, MathsImpl.fakultaet(1));
		Assert.assertEquals(120, MathsImpl.fakultaet(5));
	}

	@Test(expected=IllegalArgumentException.class)
	public void testFakultaetNotSepcified() {
		MathsImpl.fakultaet(-6);
	}
	
	@Test
	public void testnSumme() {
		Assert.assertEquals(0, MathsImpl.nSumme(0));
		Assert.assertEquals(1, MathsImpl.nSumme(1));
		Assert.assertEquals(55, MathsImpl.nSumme(10));
		Assert.assertEquals(15, MathsImpl.nSumme(-5));
		Assert.assertEquals(120, MathsImpl.nSumme(-15));
	}
	
}
